package com.xinsilu.hospital.controller;


import com.xinsilu.common.Result;
import com.xinsilu.hospital.entity.DischargeTable;
import com.xinsilu.hospital.entity.Drug;
import com.xinsilu.hospital.service.IDrugService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ym
 * @since 2021-12-15
 */
@RestController
@RequestMapping("/api/hospital/drug")
public class DrugController {

    @Autowired
    private IDrugService iDrugService;

    @RequestMapping("/tianjiayp")
    public Object tianjiayp(Drug drug) {
        boolean save = iDrugService.tianjiayp(drug);
        if(save){
            return Result.ok("成功");
        }else{
            return Result.ok("失败");
        }
    }

    @RequestMapping("/drugList")
    public Object drugList(Drug drug) {
        List<Drug> list = iDrugService.drugList(drug);
        return Result.ok(list);
    }
}
